package com.headwind.logistics.logistics.mapper;

import com.headwind.logistics.common.pojo.Coupon;
import com.headwind.logistics.logistics.dto.OrderAddressDTO;
import com.headwind.logistics.logistics.dto.QueryOrderConditionDTO;
import com.headwind.logistics.logistics.pojo.LogiPreRecordedReceipt;
import com.headwind.logistics.logistics.pojo.LogisticsOrderTail;
import com.headwind.logistics.logistics.pojo.LogisticsWorkOrder;
import com.headwind.logistics.logistics.pojo.LogisticsWorkOrderContent;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author 小恶魔
 * @Date 2020-07-28 20:05
 * @Version 1.0
 * @DESCRIPTION 顾客前台订单 数据访问层
 */
public interface LogisticsCustomerOrderMapper {

    /**
     * 获取预录单信息
     * @param page
     * @param rows
     * @param customerId
     * @return
     */
    List<LogiPreRecordedReceipt> queryPrerecordPage(@Param("page")Integer page
            ,@Param("rows")Integer rows,@Param("customerId")Long customerId);

    /**
     * 根据优惠卷id获取优惠卷信息
     * @param couponId
     * @return
     */
    Coupon queryCouponById(Long couponId);

    /**
     * 根据顾客id获取订单地址信息
     * @param customerId
     * @param page
     * @param rows
     * @return
     */
    List<OrderAddressDTO> queryOrderAddressByCustomerId(QueryOrderConditionDTO queryOrderConditionDTO, @Param("customerId")Long customerId
            , @Param("page")Integer page
            , @Param("rows")Integer rows);

    /**
     * 根据订单id获取订单跟踪信息
     * @param orderId
     * @return
     */
    List<LogisticsOrderTail> queryOrderTailByOrderId(Long orderId);

    /**
     * 添加工单
     * @param workOrder
     * @return
     */
    Integer addWorkOrder(LogisticsWorkOrder workOrder);

    /**
     * 添加工单内容
     * @param workOrderContent
     * @return
     */
    Integer addWorkOrderContent(LogisticsWorkOrderContent workOrderContent);

    /**
     * 根据订单号或顾客id获取投诉信息
     * @param orderNo
     * @param customerId
     * @return
     */
    LogisticsWorkOrder queryWorkOrderCountByCustomerIdOrOrderNo(@Param("orderNo")String orderNo
            ,@Param("customerId")Long customerId);

    /**
     * 根据预录单id修改预录单状态
     * @param prerecordId
     * @return
     */
    Integer updatePrerecordById(@Param("orderState")Integer orderState,@Param("prerecordId") Long prerecordId);

    /**
     * 根据收寄件人姓名和手机获取我寄的订单id
     * @param queryOrderConditionDTO
     * @param customerId
     * @return
     */
    List<Long> queryOrderIdBySendPutNameOrPhone(QueryOrderConditionDTO queryOrderConditionDTO,@Param("customerId")Long customerId);

    /**
     * 根据订单号获取订单跟踪信息
     * @param customerId
     * @param orderNo
     * @return
     */
    List<LogisticsOrderTail> queryOrderTailByOrderNo(Long customerId,String orderNo);
}
